package com.homework.module6part1.consumer;

import com.homework.module6part1.service.OrderService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class DlxConsumer {
    @Autowired
    private OrderService orderService;

    @RabbitListener(queues = "q.go.dlx")
    public void service(String message) {
        System.out.println("消息队列推送来的消息：" + message);
        //更新状态
        int id = Integer.parseInt(message);
        orderService.setOrderUnPay(id);
    }
}


